import DelButton from '../../../components/delbutton';
import { IData } from '../../api/professional/profession/query.api';
import Edit from './edit';
import api from '../../../atoms/api';
import Index from '../../../components';
import Table from '../../../components/table';

export default function List({ data }: { data: IData[]; }) {
	return <>
		<Table
			idfieldname='major_id'
			data={data}
			render={(record) => {
				const major_id = record.major_id;
				return <>
					<Edit data={record} />
					<DelButton query={{
						major_id
					}} dlgtitle='确认删除' api={api['/api/professional/profession/del']} />
				</>;
			}}
		>

			<Table.Column<IData> title='专业名称' key='majorname' dataIndex='majorname' align='left' />
			<Table.Column<IData> title='人才培养目标' key='objectives' dataIndex='objectives' align='left' />
			<Table.Column<IData> title='专业简介' key='professionalprofile' dataIndex='professionalprofile' align='left' />
		</Table>
	</>;
}
